package com.zxy.supplier_system.server.controller

import com.zxy.supplier_system.server.service.MarketShoppingGuideService
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PathVariable
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController

@RestController
@RequestMapping("markets/{marketId}/shoppingGuides")
class MarketsShoppingGuideController(
    private val marketShoppingGuideService: MarketShoppingGuideService
) {

    @GetMapping
    fun getAllShoppingGuidesByMarkets(@PathVariable marketId: Int): List<MarketShoppingGuideResponse> {
        return this.marketShoppingGuideService.findAllByMarketId(marketId)
    }

    data class MarketShoppingGuideResponse(
        val id:Int,
        val name: String,
        val phoneNumber: String,
    )

}